package com.DHH.Service.Capital.Impl;
import com.DHH.Entity.Capital.CapitalSurplusMoneyState;
import com.DHH.Mapper.Capital.CapitalSurplusMoneyStateMapper;
import com.DHH.Service.Capital.ICapitalSurplusMoneyStateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CapitalSurplusMoneyStateServiceImpl implements ICapitalSurplusMoneyStateService{
	
	@Autowired
    private CapitalSurplusMoneyStateMapper capitalSurplusMoneyStateMapper;
    
   @Override
   public CapitalSurplusMoneyState insertCapitalSurplusMoneyState(CapitalSurplusMoneyState capitalSurplusMoneyState){
	   
        capitalSurplusMoneyStateMapper.insertSelective(capitalSurplusMoneyState);
	   return capitalSurplusMoneyState;
	   
   };
   @Override
   public CapitalSurplusMoneyState updateCapitalSurplusMoneyState(CapitalSurplusMoneyState capitalSurplusMoneyState){
	     capitalSurplusMoneyStateMapper.updateByPrimaryKeySelective(capitalSurplusMoneyState);
        return capitalSurplusMoneyState;
   };
   @Override
   public CapitalSurplusMoneyState deleteCapitalSurplusMoneyState(CapitalSurplusMoneyState capitalSurplusMoneyState){

	     capitalSurplusMoneyStateMapper.delete(capitalSurplusMoneyState);
        return capitalSurplusMoneyState;
   };
    /**
     * 保存或更新操作，返回值为主表
     */
    public CapitalSurplusMoneyState saveOrUpdateCapitalSurplusMoneyState(CapitalSurplusMoneyState capitalSurplusMoneyState){
        if(capitalSurplusMoneyState.getId()==null)
        {
            capitalSurplusMoneyStateMapper.insertSelective(capitalSurplusMoneyState);
        }else{
            capitalSurplusMoneyStateMapper.updateByPrimaryKeySelective(capitalSurplusMoneyState);
        }
        return capitalSurplusMoneyState;
    };
}
